﻿using intelliEssay.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Core = intelliEssay.Core;
using System.Text.RegularExpressions;


namespace intelliEssay.Checkers.Reference
{
    class testEntry_Reference
    {
        public static void Main()
        {
            string s = "";
            Regex reg = new Regex(s = string.Format("^({9}){{0,1}}\\s*{1}\\.\\s*{2}(\\.\\s*{3})", RegexConstants.StartingWS, RegexConstants.Author, RegexConstants.Title,
           RegexConstants.PublicationName, RegexConstants.YearOfPublish, RegexConstants.PublicationID, RegexConstants.StartingPage, RegexConstants.EndingPage, RegexConstants.TrailingWS, RegexConstants.ReferenceIndex));
            var cnt = "王敏. 基于VC++与xml技术的文档格式检查修正的设计与实现. 都市家教上半月, 2012, 11:191~191.";
            bool isMatch = reg.IsMatch(cnt);

            var sauthor = reg.Match(cnt).Groups["author"].Value;
            var refIndx = reg.Match(cnt).Groups["refIndx"].Value;
            Core.Task task = new Core.Task();
            task.AddAChecker(new intelliEssay.Checkers.Reference.ReferenceChecker());
            task.FilePath = @"C:\Users\llmainland\Desktop\基于OpenXml的Word文档格式检查系统.docx";
            task.taskType = "nkub";
            task.taskSetting = new Core.TaskSettings()
            {
                StandardFormatDocumentPath =
                    @"E:\Programs\ProjectEssayCompiler\TestDrive\intelliEssay\standard format.docx"
            };
            task.Initialize();
            task.Run(TaskRunMode.Console);
        }
    }
}
